package com.m3839.sdk.login;

import android.app.Activity;

import com.cby.lib.tool.CbyTool;
import com.m3839.sdk.common.GlobalManager;
import com.m3839.sdk.login.core.LoginManager;
import com.m3839.sdk.login.core.InitManager;
import com.m3839.sdk.login.listener.HykbInitListener;
import com.m3839.sdk.login.listener.HykbLoginListener;

/**
 * @author ChenBaoyang
 * @description: LoginSDK
 * @date 2021/11/12 16:15
 */
public class HykbLoginSDK {

    public static void init(Activity activity, String gameId, boolean debug, int orientation, HykbInitListener listener) {
        if(debug) {
            CbyTool.setFloat(activity.getApplication());
        }
        GlobalManager.getInstance().init();
        InitManager.getInstance().initConfig(activity, gameId, orientation, listener);
    }


    /**
     * 登录接口
     * @param activity
     */
    public static void login(Activity activity, HykbLoginListener listener){
        LoginManager.getInstance().doLogin(activity, false, listener);
    }

    /**
     * 退出登录接口
     */
    public static void logout(){
        LoginManager.getInstance().logout();
    }

    /**
     * 切换账号接口
     * @param activity
     */
    public static void switchAccount(Activity activity, HykbLoginListener listener){
        LoginManager.getInstance().doLogin(activity,true, listener);
    }


}
